package com.shop.cereshop.agent.controller.product;

import com.shop.cereshop.agent.page.product.AgentProductClassifyVO;
import com.shop.cereshop.agent.service.product.AgentProductClassifyService;
import com.shop.cereshop.commons.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:
 * @author lx
 * @date 2025/11/3 13:23
 * @version 1.0
 */
@RestController
@RequestMapping("classify")
@Slf4j(topic = "AgentProductClassifyController")
@Api(value = "代理商商品分类模块", tags = "代理商商品分类模块")
public class AgentProductClassifyController {

    @Resource
    private AgentProductClassifyService agentProductClassifyService;

    @GetMapping("list")
    @ApiOperation(value = "获取商品分类列表接口")
    public Result<List<AgentProductClassifyVO>> getClassifyList(@RequestParam(value = "分类id", required = false)
                                                                @ApiParam (value = "分类id(查一级分类是不传值)") Long classifyId) {
        return Result.success(agentProductClassifyService.getClassifyList(classifyId));
    }
}
